﻿using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Text;
using Timesheet.Data.Infrastructure;
using Timesheet.Domain;

namespace Timesheet.Data.Repository
{
    public class UserRepository : Repository<User>, IUserRepository
    {
        public UserRepository(IUnitOfWork unit)
            : base(unit)
        {
        }

        #region IUserRepository Members

        public User getUserByUsername(string username)
        {
            return DbSet.FirstOrDefault(p => p.Username == username);
        }       
        
        public IQueryable<User> GetQuery()
        {
            return DbSet;
        }

        #endregion
    }
}
